#include "List.h"
using namespace std;

int main()
{

    YX::TestList1();

    return 0;
}












//#include <iostream>
//#include <unistd.h>
//#include <sys/wait.h>
//#include <stdlib.h>
//#include <sys/types.h>
//#include <vector>
//#include <stdio.h>
//using namespace std;
//
//int main()
//{
//
//    cout<<"代码开始"<<endl;
//
//
//   execl("/usr/bin/ls","ls","-l",NULL); 
//
//
//    cout<<"代码结束"<<endl;
//
//    return 0;
//}
//
//
////typedef void(*func_t)();
////
////void func1()
////{
////    cout<<"任务一"<<endl;
////}
////
////void func2()
////{
////
////    cout<<"任务二"<<endl;
////}
////
////void func3()
////{
////    
////    cout<<"任务三"<<endl;
////}
////
////vector<func_t> v;
////
////
////int main(int argc,char* argv[],char* env[])
////{
////    pid_t id=fork(); // 创建子进程
////
////    if(id<0)
////    {
////
////    }
////    else if(id==0)
////    {
////        // 子进程
////        int count=5;
////        while(count--)
////        {
////             printf("子进程  pid: %d ppid: %d id: %d\n",getpid(),getppid(),id);
////            sleep(1);
////        }
////        exit(1);
////    }
////    else 
////    {
////        // 父进程    
////        printf("父进程  pid: %d ppid: %d id: %d\n",getpid(),getppid(),id);
////
////        v.push_back(func1);
////        v.push_back(func2);
////        v.push_back(func3);
////
////        size_t pos=0;
////
////        int status=0;
////        while(true)
////        {
////            pid_t ret=waitpid(id,&status,WNOHANG); // 非阻塞式等待
////
////            if(ret<0) 
////            {
////                printf("等待失败 ret:%d\n",ret);
////                break;
////            }
////            else if(ret==0)
////            {
////                printf("子进程还未退出，继续等待 ret:%d\n",ret);
////                
////                // 子进程还未退出，等待子进程退出的时候父进程可以先执行一些任务
////                
////                if(pos<v.size())
////                {
////                    v[pos]();
////                    pos++;
////                }
////                sleep(1);
////            }
////            else 
////            {
////                printf("等待成功 ret:%d 退出码:%d 退出信号:%d\n",ret,(status>>8)&0xFF,status&0x7F);
////                break;
////            }
////        }
////    }
////
////
////
////    return 0;
////}
////
//////int main(int argc,char* argv[],char* env[])
//////{
//////    pid_t id=fork();
//////
//////    if(id<0)
//////    {
//////
//////    }
//////    else if(id==0)
//////    {
//////        // 子进程
//////        int count=5;
//////        while(count--)
//////        {
//////             printf("子进程: id: %d pid: %d ppid: %d\n",id,getpid(),getppid());
//////             sleep(1);
//////        }
//////
//////        //int* p=NULL; 段错误 信号11
//////        //*p=0;
//////        
//////        //int p=10/0; 信号8
//////
//////        exit(1);
//////    }
//////    else 
//////    {
//////
//////        int status=0;
//////        printf("父进程: id: %d pid: %d ppid: %d\n",id,getpid(),getppid());
//////
//////
//////        pid_t ret=waitpid(id,&status,0); // 阻塞式等待
//////        if(ret>0)
//////        {
//////            printf("等待子进程成功: 退出码: %d 退出信号: %d\n",(status>>8)&0xFF,status&0x7F);
//////        }
//////
//////    }
//////
//////
//////
//////
//////    return 0;
//////}
